mui.init();
var jc_content;
mui.plusReady(function () {
    var category;
    var mobile;
    var questionID;
    var self = plus.webview.currentWebview();
    questionID = self.question_id;
    category = self.category;

    jc_content = new Vue({
        el: '#jc_box',
        data: {
            question_id:questionID,
            category:category,
            con: '',
			bq:0,
            yes_num:300
        },
		watch:{
            con:function () {
                var str = this.con;
                var len = str.replace(/[\u0391-\uFFE5]/g,"aa").length;
                this.yes_num = 300 -len;
            },
			bq:function () {
				console.log(this.bq);
            }
		},
		methods:{
            jc_submit:function () {
                var api_host = plus.storage.getItem('HOST_URL');
                $.ajax({
                    type: "POST",
                    dataType: "json",
                    url: api_host+"/api/questionbank/public/wrong_question_post",
                    data: $('#jc_form').serialize(),
                    headers:{'User-Token':plus.storage.getItem('UserToken')},
                    timeout:3000,
                    success: function (msg) {
                        mui.toast(msg.msg,{ duration:'3000', type:'div'});
                    },
                    error : function() {
                        console.log("导入异常！");
                    }
                });
            }
		}
    })
    plus.nativeUI.closeWaiting();
    mui.currentWebview.show();
})

